package com.qf.controller.swagger;/*
 *徐韬
 *2021/11/3
 *11:18
 */

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import sun.java2d.pipe.AATileGenerator;

@Configuration
@EnableSwagger2
public class swaggerConfig {
    @Bean
    public ApiInfo apiInfo(){
        return new ApiInfoBuilder()
                .version("2.1.0.alpha")
                .description("测试功能")
                .title("在线测试")
                .license("apache2.0")
                .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0")
                .contact(new Contact("xt", "2306xt.com", "202921@qq.com"))
                .build();
    }
    @Bean
    public Docket docket(ApiInfo apiInfo){
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).select().apis(RequestHandlerSelectors.basePackage("com.qf.controller")).build();
    }
}
